package com.service.business.rabbitmq.binding;

import com.service.business.pay.dto.PayOrder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.messaging.support.MessageBuilder;


@Slf4j
//@EnableBinding(PointsOrderSink.class)
public class PointOrderSendHandler {

    @Autowired
    private PointsOrderSink source;

    public void sendPayPointsOrderMsg(PayOrder payOrder) {
        log.info("支付积分订单发送消息:{}", payOrder);
        source.outPayPointsOrder().send(MessageBuilder.withPayload(payOrder).build());
    }

}
